package cn.blog.service.front;

import java.sql.Date;
import java.util.List;

import cn.blog.dao.conn.ParamSet;
import cn.blog.dao.front.ArtilceDao;
import cn.blog.dao.front.ClassDao;
import cn.blog.dao.front.RzglArtInfoDao;
import cn.blog.entity.addBean.RzglArtInfo;
import cn.blog.entity.origin.ClassBean;

public class RizhiglService {

	private ClassDao classDao;
	private ArtilceDao artDao;
	private RzglArtInfoDao rzglDao;
	public RizhiglService() {
		classDao = new ClassDao();
		artDao = new ArtilceDao();
		rzglDao = new RzglArtInfoDao();
	}


	public List<ClassBean> classAll() {
		// TODO Auto-generated method stub
		return classDao.cla();
	}


	public int addTitle(int uid, String title,int claId,  Date artTime, int read, String artText, String state) {
		return artDao.addTitle(uid,title,claId,artTime,read,artText,state);
		// TODO Auto-generated method stub
		
	}
	/**
	 * 根据用户编号查询和文章状态查询文章
	 * 
	 * @param artId
	 *            用户编号
	 * @param state
	 *            文章状态
	 * @return
	 */
	public List<RzglArtInfo> getArticleAll(int userId, String state) {
		return rzglDao.getArticleAll(userId, state);

	}

	/**
	 * 根据用户编号查询和文章状态,文章编号，文章类型查询文章
	 * 
	 * @param userId
	 *            用户编号
	 * @param state
	 *            文章状态
	 * @param artId
	 *            文章编号
	 * @param cla
	 *            文章类型
	 * @return
	 */
	public List<RzglArtInfo> getArticle(int userId, String state, int artId, String cla) {
		
		return rzglDao.getArticle(userId, state, artId, cla);

	}


	public int updateArt(String xgartTitle, int parseInt, int parseInt2, String string) {
		return artDao.updateArt(xgartTitle, parseInt,  parseInt2, string);
		// TODO Auto-generated method stub
		
	}
}
